﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Repetition.DatabaseCreator
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Do you really want to create the database? Existing tables will be dropped! (y/n)");
            string answer = Console.ReadLine();

            if (answer.ToLower() == "y")
            {
                try
                {
                    DatabaseCreator.Create();
                    Console.WriteLine("The database has been created.");
                    Console.WriteLine("Create test data? (y/n)");
                    answer = Console.ReadLine();

                    if (answer.ToLower() == "y")
                    {
                        DatabaseCreator.AddTestData();
                        Console.WriteLine("Test data has been created.");
                    }
                }
                catch (Exception e)
                {
                    Console.WriteLine(e.Message);
                }

                Console.ReadLine();
            }
        }
    }
}
